﻿using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Data.Schema.UnitTesting;
using Microsoft.Data.Schema.UnitTesting.Conditions;

namespace TestNorthwind
{
    [TestClass()]
    public class TenMostExpensiveProductsUnitTest : DatabaseTestClass
    {

        public TenMostExpensiveProductsUnitTest()
        {
            InitializeComponent();
        }

        [TestInitialize()]
        public void TestInitialize()
        {
            base.InitializeTest();
        }
        [TestCleanup()]
        public void TestCleanup()
        {
            base.CleanupTest();
        }

        #region 设计器支持代码

        /// <summary> 
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction dbo_Ten_Most_Expensive_ProductsTest_TestAction;
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TenMostExpensiveProductsUnitTest));
            Microsoft.Data.Schema.UnitTesting.Conditions.RowCountCondition rowCountCondition1;
            this.dbo_Ten_Most_Expensive_ProductsTestData = new Microsoft.Data.Schema.UnitTesting.DatabaseTestActions();
            dbo_Ten_Most_Expensive_ProductsTest_TestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            rowCountCondition1 = new Microsoft.Data.Schema.UnitTesting.Conditions.RowCountCondition();
            // 
            // dbo_Ten_Most_Expensive_ProductsTestData
            // 
            this.dbo_Ten_Most_Expensive_ProductsTestData.PosttestAction = null;
            this.dbo_Ten_Most_Expensive_ProductsTestData.PretestAction = null;
            this.dbo_Ten_Most_Expensive_ProductsTestData.TestAction = dbo_Ten_Most_Expensive_ProductsTest_TestAction;
            // 
            // dbo_Ten_Most_Expensive_ProductsTest_TestAction
            // 
            dbo_Ten_Most_Expensive_ProductsTest_TestAction.Conditions.Add(rowCountCondition1);
            resources.ApplyResources(dbo_Ten_Most_Expensive_ProductsTest_TestAction, "dbo_Ten_Most_Expensive_ProductsTest_TestAction");
            // 
            // rowCountCondition1
            // 
            rowCountCondition1.Enabled = true;
            rowCountCondition1.Name = "rowCountCondition1";
            rowCountCondition1.ResultSet = 1;
            rowCountCondition1.RowCount = 10;
        }

        #endregion


        #region 附加测试特性
        //
        // 编写测试时，可以使用以下附加特性:
        //
        // 在运行类中的第一个测试之前使用 ClassInitialize 运行代码
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // 在类中的所有测试都已运行之后使用 ClassCleanup 运行代码
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        #endregion


        [TestMethod()]
        public void dbo_Ten_Most_Expensive_ProductsTest()
        {
            DatabaseTestActions testActions = this.dbo_Ten_Most_Expensive_ProductsTestData;
            // 执行预先测试脚本
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "正在执行 预先测试 脚本...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // 执行测试脚本
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "正在执行 测试 脚本...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // 执行后期测试脚本
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "正在执行 后期测试 脚本...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        private DatabaseTestActions dbo_Ten_Most_Expensive_ProductsTestData;
    }
}
